package com.xinsilu.hospital.controller;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.xinsilu.common.Result;
import com.xinsilu.hospital.entity.DrugTable;
import com.xinsilu.hospital.entity.DrugrecordTasble;
import com.xinsilu.hospital.mapper.DrugrecordTableMapper;
import com.xinsilu.hospital.service.IDrugrecordTableService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/api/hospital/drugrecordtable")
public class DrudrecordTableController {
    @Autowired
    private IDrugrecordTableService iDrugrecordTableService;
    

    /**
     * 返回所有数据
     * @return
     */
    @RequestMapping("/getList")
    public Object getList() {
        List<DrugrecordTasble> list = iDrugrecordTableService.list(null);
        return Result.ok(list);
    }

    @RequestMapping("/getListDrug")
    public Object getListDrug(DrugrecordTasble drugrecordTasble){
        System.out.println(drugrecordTasble.getOperationtype());
        List<DrugrecordTasble> drug = iDrugrecordTableService.listDrug(drugrecordTasble);
        System.out.println(drug);

        return  Result.ok(drug);

  }


}
